﻿using System.Windows.Forms;
using Pibby.Core;

namespace Pibby.Controls
{
	public class ListViewDurationSubItem : ListViewItem.ListViewSubItem
	{
		private readonly long _duration;

		public ListViewDurationSubItem(string d)
			: base()
		{
			var duration = new Duration(d);

			this.Text = duration.ToString();
			this._duration = duration.Value;
		}

		public long Duration
		{
			get
			{
				return _duration;
			}
		}

		public static int Compare(ListViewDurationSubItem first, ListViewDurationSubItem second)
		{
			return (int)(first.Duration - second.Duration);
		}
	}
}
